package com.huluobo.a2307douyindemo.demo.touch

import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
import android.widget.LinearLayout

/**
 *  Created by LC on 2025/9/17.
 */
class TouchLayout(context: Context, attributeSet: AttributeSet) : LinearLayout(context, attributeSet) {
    //分发
    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        Log.e("TagA", "Layout分发:${ev?.action}")
        return super.dispatchTouchEvent(ev)
    }

    //消费
    override fun onTouchEvent(event: MotionEvent?): Boolean {
        Log.e("TagA", "Layout消费:${event?.action}")
        return super.onTouchEvent(event)
    }

    //拦截
    override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
        Log.e("TagA", "Layout拦截:${ev?.action}")
        return super.onInterceptTouchEvent(ev)
    }
}